﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Extjs_ReGSharp.Sorting
{
	internal class BooleanComparer<T> : IDefaultComparer<T>
	{
		#region IDefaultComparer<T> Members

		public int Compare(T firstVar, T secondVar, System.Reflection.PropertyInfo propertyToCompare)
		{
			bool firstVarPropertyValue = (bool)propertyToCompare.GetValue(firstVar, null);
			bool secondVarPropertyValue = (bool)propertyToCompare.GetValue(secondVar, null);

			return firstVarPropertyValue.CompareTo(secondVarPropertyValue);
		}

		#endregion
	}
}
